package com.dfbz.bigdata.modules.system.doman;



import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName tb_common_contract
 */
@TableName(value ="tb_common_contract")
@Data
public class CommonContract implements Serializable {
    /**
     * 合同id
     */
    @TableId
    private Long contractId;

    /**
     * 订单号
     */
    private String contractNum;

    /**
     * 甲方
     */
    private Long partyAId;

    /**
     * 乙方
     */
    private Long partyBId;

    /**
     * 订单id
     */
    private Long odId;

    /**
     * 协议内容
     */
    private String contractText;

    /**
     * 违约责任
     */
    private String contractDuty;

    /**
     * 合同期限
     */
    private Integer contractDeadline;

    /**
     * 价格
     */
    private Double contractValue;

    /**
     * 开始时间
     */
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date contractTime;

    /**
     * 创建时间
     */
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;

    /**
     * 更新时间
     */
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date updateTime;

    /**
     * 创建人
     */
    private Long createUser;

    /**
     * 修改人
     */
    private Long updateUser;

    /**
     * 是否删除
     */
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CommonContract other = (CommonContract) that;
        return (this.getContractId() == null ? other.getContractId() == null : this.getContractId().equals(other.getContractId()))
            && (this.getContractNum() == null ? other.getContractNum() == null : this.getContractNum().equals(other.getContractNum()))
            && (this.getPartyAId() == null ? other.getPartyAId() == null : this.getPartyAId().equals(other.getPartyAId()))
            && (this.getPartyBId() == null ? other.getPartyBId() == null : this.getPartyBId().equals(other.getPartyBId()))
            && (this.getOdId() == null ? other.getOdId() == null : this.getOdId().equals(other.getOdId()))
            && (this.getContractText() == null ? other.getContractText() == null : this.getContractText().equals(other.getContractText()))
            && (this.getContractDuty() == null ? other.getContractDuty() == null : this.getContractDuty().equals(other.getContractDuty()))
            && (this.getContractDeadline() == null ? other.getContractDeadline() == null : this.getContractDeadline().equals(other.getContractDeadline()))
            && (this.getContractValue() == null ? other.getContractValue() == null : this.getContractValue().equals(other.getContractValue()))
            && (this.getContractTime() == null ? other.getContractTime() == null : this.getContractTime().equals(other.getContractTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
            && (this.getUpdateUser() == null ? other.getUpdateUser() == null : this.getUpdateUser().equals(other.getUpdateUser()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getContractId() == null) ? 0 : getContractId().hashCode());
        result = prime * result + ((getContractNum() == null) ? 0 : getContractNum().hashCode());
        result = prime * result + ((getPartyAId() == null) ? 0 : getPartyAId().hashCode());
        result = prime * result + ((getPartyBId() == null) ? 0 : getPartyBId().hashCode());
        result = prime * result + ((getOdId() == null) ? 0 : getOdId().hashCode());
        result = prime * result + ((getContractText() == null) ? 0 : getContractText().hashCode());
        result = prime * result + ((getContractDuty() == null) ? 0 : getContractDuty().hashCode());
        result = prime * result + ((getContractDeadline() == null) ? 0 : getContractDeadline().hashCode());
        result = prime * result + ((getContractValue() == null) ? 0 : getContractValue().hashCode());
        result = prime * result + ((getContractTime() == null) ? 0 : getContractTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getCreateUser() == null) ? 0 : getCreateUser().hashCode());
        result = prime * result + ((getUpdateUser() == null) ? 0 : getUpdateUser().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", contractId=").append(contractId);
        sb.append(", contractNum=").append(contractNum);
        sb.append(", partyAId=").append(partyAId);
        sb.append(", partyBId=").append(partyBId);
        sb.append(", odId=").append(odId);
        sb.append(", contractText=").append(contractText);
        sb.append(", contractDuty=").append(contractDuty);
        sb.append(", contractDeadline=").append(contractDeadline);
        sb.append(", contractValue=").append(contractValue);
        sb.append(", contractTime=").append(contractTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", createUser=").append(createUser);
        sb.append(", updateUser=").append(updateUser);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}